# Analysis ID : Certara.R School Lesson 4 - Modeling with RsNLME
# Purpose : Introduce R Markdown
# Other Info :
library(flextable)
library(plotly)
The purpose of this data memo is to provide a summary of the base population pharmacokinetic model fit for study XYZ
dm_table <- readRDS(file='../Lesson_4/dmtable.RDS')
dm_table
| Characteristic | N = 1501 |
|---|---|
| AGE | 50.5 (38.0 - 61.0) |
| WT | 71 (55 - 94) |
| SEX | |
| F | 45 (30%) |
| M | 105 (70%) |
| RACE | |
| ASIAN | 21 (14%) |
| BLACK | 36 (24%) |
| OTHER | 33 (22%) |
| WHITE | 60 (40%) |
| 1 Mean (Range); n (%) | |
mean_conc_table <- readRDS(file='../Lesson_4/mean_conc_table.RDS')
mean_conc_table
Dose Group | |||
Time (hr) | 5000 μg | 10000 μg | 20000 μg |
0.00 | 0 (0-0) | 0 (0-0) | 0 (0-0) |
0.25 | 19.5 (5.19-56.4) | 38.8 (4.77-111) | 58.3 (6.83-164) |
0.50 | 32.6 (9.88-84.3) | 64.9 (19-167) | 96.9 (27.9-247) |
1.00 | 48.1 (17.2-119) | 96.3 (30.6-235) | 144 (41.1-349) |
2.00 | 56.2 (17.7-116) | 112 (32.7-236) | 169 (51.7-352) |
3.00 | 55.8 (19.8-118) | 112 (37.7-235) | 167 (56-348) |
4.00 | 51.7 (15.4-131) | 103 (27.5-264) | 155 (37.8-400) |
6.00 | 41.2 (9.77-91.4) | 82.4 (14.3-182) | 124 (21.9-270) |
8.00 | 34.7 (9.36-67) | 69.9 (21.7-136) | 104 (29.8-199) |
12.00 | 25 (2.98-69.8) | 49.6 (5.06-140) | 75.8 (8.52-208) |
16.00 | 18.7 (1.08-57.5) | 37.5 (0-115) | 56.8 (0-169) |
24.00 | 9.52 (0.103-32.9) | 19.3 (0-67.3) | 28.1 (0-99.8) |
pkplot <- readRDS(file='../Lesson_4/pkplot.RDS')
ggplotly(pkplot)
pkplotlog <- readRDS(file='../Lesson_4/pkplotlog.RDS')
pkplotlog
pkplot_dosesex <- readRDS(file='../Lesson_4/pkplot_dosesex.RDS')
pkplot_dosesex
pkplot_doserace <- readRDS(file='../Lesson_4/pkplot_doserace.RDS')
pkplot_doserace
pkplot_dosewt <- readRDS(file='../Lesson_4/pkplot_dosewt.RDS')
pkplot_dosewt
pkplot_doseage <- readRDS(file='../Lesson_4/pkplot_doseage.RDS')
pkplot_doseage
Structural PK Model
## View the updated model
basemod<-readRDS("../Lesson_5/basemod.RDS")
print(basemod)
## Loading required package: Certara.RsNLME
##
## Model Overview
## -------------------------------------------
## Is population : TRUE
## Model Type : PK
##
## PK
## -------------------------------------------
## Parameterization : Clearance
## Absorption : FirstOrder
## Num Compartments : 1
## Dose Tlag? : FALSE
## Elimination Comp ?: FALSE
## Infusion Allowed ?: FALSE
## Sequential : FALSE
## Freeze PK : FALSE
##
## PML
## -------------------------------------------
## test(){
## cfMicro(A1,Cl/V, first = (Aa = Ka))
## dosepoint(Aa)
## C = A1 / V
## error(CEps=5)
## observe(CObs=C + CEps)
## stparm(Ka = tvKa * exp(nKa))
## stparm(V = tvV * exp(nV))
## stparm(Cl = tvCl * exp(nCl))
## fcovariate(AGE)
## fcovariate(WT)
## fcovariate(SEX())
## fcovariate(RACE())
## fcovariate(DOSEGRP)
## fixef( tvKa = c(,1.5,))
## fixef( tvV = c(,80,))
## fixef( tvCl = c(,9,))
## ranef(diag(nKa,nV,nCl) = c(0.1,0.1,0.1))
## }
##
## Structural Parameters
## -------------------------------------------
## Ka V Cl
## -------------------------------------------
## Observations:
## Observation Name : CObs
## Effect Name : C
## Epsilon Name : CEps
## Epsilon Type : Additive
## Epsilon frozen : FALSE
## is BQL : FALSE
## -------------------------------------------
## Column Mappings
## -------------------------------------------
## Model Variable Name : Data Column name
## id : ID
## time : TIME
## Aa : AMT
## AGE : AGE
## WT : WT
## SEX : SEX( M=0 F=1 )
## RACE : RACE( WHITE=0 BLACK=1 ASIAN=2 OTHER=3 )
## DOSEGRP : DOSEGRP
## CObs : CONC
## View the updated model
basemodfit<-readRDS("../Lesson_5/basemodfit.RDS")
print(basemodfit)
## $Overall
## Scenario RetCode LogLik -2LL AIC BIC nParm nObs nSub
## 1: WorkFlow 1 -7187.912 14375.82 14389.82 14427.68 7 1650 150
## EpsShrinkage Condition
## 1: 0.10699 73.06982
##
## $theta
## #Scenario Parameter Estimate Units Stderr CV% 2.5%CI 97.5%CI
## 1: WorkFlow tvKa 1.195375 NA 0.03937092 3.293605 1.118152 1.272597
## 2: WorkFlow tvV 80.425584 NA 2.83247767 3.521861 74.869937 85.981231
## 3: WorkFlow tvCl 7.731636 NA 0.42486324 5.495127 6.898305 8.564967
## 4: WorkFlow CEps 13.789523 NA 0.77473096 5.618258 12.269959 15.309088
## Var.Inf.factor
## 1: NA
## 2: NA
## 3: NA
## 4: NA
##
## $omega
## Label nKa nV nCl
## 1: nKa 0.07185426 0.0000000 0.0000000
## 2: nV 0.00000000 0.1687598 0.0000000
## 3: nCl 0.00000000 0.0000000 0.3953833
##
## $omega_Correlation
## Label nKa nV nCl
## 1: nKa 1 0 0
## 2: nV 0 1 0
## 3: nCl 0 0 1
##
## $Eta_Shrinkage
## Label nKa nV nCl
## 1: Shrinkage 0.3216746 0.05676357 0.06095907
##
## $omega_stderr
## Label nKa nV nCl
## 1: nKa 0.01546955 0.00000000 0.00000000
## 2: nV 0.00000000 0.02327878 0.00000000
## 3: nCl 0.00000000 0.00000000 0.04707696
## View the updated model
basemodNewfit<-readRDS("../Lesson_6/basemodNewfit.RDS")
print(basemodNewfit)
## $Overall
## Scenario RetCode LogLik -2LL AIC BIC nParm nObs nSub
## 1: WorkFlow 1 -6744.071 13488.14 13502.14 13540 7 1650 150
## EpsShrinkage Condition
## 1: 0.12191 87.19756
##
## $theta
## #Scenario Parameter Estimate Units Stderr CV% 2.5%CI
## 1: WorkFlow tvKa 1.1754929 NA 0.034656912 2.948288 1.1075165
## 2: WorkFlow tvV 81.3292974 NA 2.958785126 3.638031 75.5259100
## 3: WorkFlow tvCl 7.9344104 NA 0.413967465 5.217369 7.1224510
## 4: WorkFlow CEps 0.2066483 NA 0.009880772 4.781443 0.1872681
## 97.5%CI Var.Inf.factor
## 1: 1.2434693 NA
## 2: 87.1326849 NA
## 3: 8.7463699 NA
## 4: 0.2260286 NA
##
## $omega
## Label nKa nV nCl
## 1: nKa 0.07954013 0.0000000 0.0000000
## 2: nV 0.00000000 0.1782003 0.0000000
## 3: nCl 0.00000000 0.0000000 0.3700297
##
## $omega_Correlation
## Label nKa nV nCl
## 1: nKa 1 0 0
## 2: nV 0 1 0
## 3: nCl 0 0 1
##
## $Eta_Shrinkage
## Label nKa nV nCl
## 1: Shrinkage 0.2154865 0.03304809 0.02180766
##
## $omega_stderr
## Label nKa nV nCl
## 1: nKa 0.01541487 0.00000000 0.00000000
## 2: nV 0.00000000 0.02314708 0.00000000
## 3: nCl 0.00000000 0.00000000 0.03886903
basedvpred <- readRDS(file='../Lesson_6/basedvpred.RDS')
basedvpred
basedvipred <- readRDS(file='../Lesson_6/basedvipred.RDS')
basedvipred
baseresidv <- readRDS(file='../Lesson_6/baseresidv.RDS')
baseresidv
baserespred <- readRDS(file='../Lesson_6/baserespred.RDS')
baserespred
basearespred <- readRDS(file='../Lesson_6/basearespred.RDS')
basearespred
baseprmcovwt <- readRDS(file='../Lesson_6/baseprmcovwt.RDS')
baseprmcovwt
baseetacovwt <- readRDS(file='../Lesson_6/baseetacovwt.RDS')
baseetacovwt
basenewdvpred <- readRDS(file='../Lesson_6/basenewdvpred.RDS')
basenewdvpred
basenewdvipred <- readRDS(file='../Lesson_6/basenewdvipred.RDS')
basenewdvipred
basenewresidv <- readRDS(file='../Lesson_6/basenewresidv.RDS')
basenewresidv
basenewrespred <- readRDS(file='../Lesson_6/basenewrespred.RDS')
basenewrespred
basenewarespred <- readRDS(file='../Lesson_6/basenewarespred.RDS')
basenewarespred
basenewprmcovwt <- readRDS(file='../Lesson_6/basenewprmcovwt.RDS')
basenewprmcovwt
basenewetacovwt <- readRDS(file='../Lesson_6/basenewetacovwt.RDS')
basenewetacovwt
basenewranparcov <- readRDS(file='../Lesson_6/basenewranparcov.RDS')
basenewranparcov
## [[1]]
run1WTonCLfit<-readRDS("../Lesson_6/run1WTonCLfit.RDS")
print(run1WTonCLfit)
## $Overall
## Scenario RetCode LogLik -2LL AIC BIC nParm nObs nSub
## 1: WorkFlow 1 -6717.733 13435.47 13451.47 13494.74 8 1650 150
## EpsShrinkage Condition
## 1: 0.12181 87.91124
##
## $theta
## #Scenario Parameter Estimate Units Stderr CV% 2.5%CI
## 1: WorkFlow tvKa 1.1786065 NA 0.034745861 2.948046 1.1104557
## 2: WorkFlow tvV 81.6550756 NA 2.989533797 3.661173 75.7913748
## 3: WorkFlow tvCl 7.7782270 NA 0.345639551 4.443680 7.1002862
## 4: WorkFlow dCldWT 2.7880019 NA 0.337859458 12.118337 2.1253211
## 5: WorkFlow CEps 0.2067064 NA 0.009895362 4.787158 0.1872975
## 97.5%CI Var.Inf.factor
## 1: 1.2467574 NA
## 2: 87.5187764 NA
## 3: 8.4561678 NA
## 4: 3.4506828 NA
## 5: 0.2261153 NA
##
## $omega
## Label nKa nV nCl
## 1: nKa 0.07919197 0.000000 0.000000
## 2: nV 0.00000000 0.179176 0.000000
## 3: nCl 0.00000000 0.000000 0.259979
##
## $omega_Correlation
## Label nKa nV nCl
## 1: nKa 1 0 0
## 2: nV 0 1 0
## 3: nCl 0 0 1
##
## $Eta_Shrinkage
## Label nKa nV nCl
## 1: Shrinkage 0.2176036 0.0361539 0.02312065
##
## $omega_stderr
## Label nKa nV nCl
## 1: nKa 0.01552033 0.00000000 0.00000000
## 2: nV 0.00000000 0.02348581 0.00000000
## 3: nCl 0.00000000 0.00000000 0.02618201
run1dvpred <- readRDS(file='../Lesson_6/run1dvpred.RDS')
run1dvpred
run1dvipred <- readRDS(file='../Lesson_6/run1dvipred.RDS')
run1dvipred
run1residv <- readRDS(file='../Lesson_6/run1residv.RDS')
run1residv
run1respred <- readRDS(file='../Lesson_6/run1respred.RDS')
run1respred
run1ranparcov <- readRDS(file='../Lesson_6/run1ranparcov.RDS')
run1ranparcov
## [[1]]
run2SEXonCLfit<-readRDS("../Lesson_6/run2SEXonCLfit.RDS")
print(run2SEXonCLfit)
## $Overall
## Scenario RetCode LogLik -2LL AIC BIC nParm nObs nSub
## 1: WorkFlow 1 -6742.824 13485.65 13501.65 13544.92 8 1650 150
## EpsShrinkage Condition
## 1: 0.12214 88.17658
##
## $theta
## #Scenario Parameter Estimate Units Stderr CV% 2.5%CI
## 1: WorkFlow tvKa 1.1760957 NA 0.034680123 2.948750 1.1080738
## 2: WorkFlow tvV 81.5210067 NA 2.974464460 3.648709 75.6868631
## 3: WorkFlow tvCl 8.3451700 NA 0.515055134 6.171895 7.3349359
## 4: WorkFlow dCldSEX1 -0.1753534 NA 0.123366998 -70.353348 -0.4173266
## 5: WorkFlow CEps 0.2066220 NA 0.009864526 4.774190 0.1872736
## 97.5%CI Var.Inf.factor
## 1: 1.24411767 NA
## 2: 87.35515040 NA
## 3: 9.35540422 NA
## 4: 0.06661982 NA
## 5: 0.22597038 NA
##
## $omega
## Label nKa nV nCl
## 1: nKa 0.08075958 0.0000000 0.0000000
## 2: nV 0.00000000 0.1787324 0.0000000
## 3: nCl 0.00000000 0.0000000 0.3648156
##
## $omega_Correlation
## Label nKa nV nCl
## 1: nKa 1 0 0
## 2: nV 0 1 0
## 3: nCl 0 0 1
##
## $Eta_Shrinkage
## Label nKa nV nCl
## 1: Shrinkage 0.2172781 0.0340716 0.02289959
##
## $omega_stderr
## Label nKa nV nCl
## 1: nKa 0.01527397 0.00000000 0.0000000
## 2: nV 0.00000000 0.02297015 0.0000000
## 3: nCl 0.00000000 0.00000000 0.0377524
run2dvpred <- readRDS(file='../Lesson_6/run2dvpred.RDS')
run2dvpred
run2dvipred <- readRDS(file='../Lesson_6/run2dvipred.RDS')
run2dvipred
run2residv <- readRDS(file='../Lesson_6/run2residv.RDS')
run2residv
run2respred <- readRDS(file='../Lesson_6/run2respred.RDS')
run2respred
run2ranparcov <- readRDS(file='../Lesson_6/run2ranparcov.RDS')
run2ranparcov
## [[1]]
run3WTonVfit<-readRDS("../Lesson_6/run3WTonVfit.RDS")
print(run3WTonVfit)
## $Overall
## Scenario RetCode LogLik -2LL AIC BIC nParm nObs nSub EpsShrinkage
## 1: WorkFlow 1 -6744.001 13488 13504 13547.27 8 1650 150 0.12163
## Condition
## 1: 86.59649
##
## $theta
## #Scenario Parameter Estimate Units Stderr CV% 2.5%CI
## 1: WorkFlow tvKa 1.17641505 NA 0.034686594 2.948500 1.10838043
## 2: WorkFlow tvV 81.39155371 NA 2.937346436 3.608908 75.63021369
## 3: WorkFlow tvCl 7.93844179 NA 0.416274785 5.243785 7.12195636
## 4: WorkFlow dVdWT 0.09994762 NA 0.093570298 93.619333 -0.08358207
## 5: WorkFlow CEps 0.20651568 NA 0.009874888 4.781665 0.18714698
## 97.5%CI Var.Inf.factor
## 1: 1.2444497 NA
## 2: 87.1528937 NA
## 3: 8.7549272 NA
## 4: 0.2834773 NA
## 5: 0.2258844 NA
##
## $omega
## Label nKa nV nCl
## 1: nKa 0.08045648 0.0000000 0.0000000
## 2: nV 0.00000000 0.1787547 0.0000000
## 3: nCl 0.00000000 0.0000000 0.3701806
##
## $omega_Correlation
## Label nKa nV nCl
## 1: nKa 1 0 0
## 2: nV 0 1 0
## 3: nCl 0 0 1
##
## $Eta_Shrinkage
## Label nKa nV nCl
## 1: Shrinkage 0.2166662 0.03497187 0.02198842
##
## $omega_stderr
## Label nKa nV nCl
## 1: nKa 0.01552308 0.00000000 0.00000000
## 2: nV 0.00000000 0.02328304 0.00000000
## 3: nCl 0.00000000 0.00000000 0.03884049
run3dvpred <- readRDS(file='../Lesson_6/run3dvpred.RDS')
run3dvpred
run3dvipred <- readRDS(file='../Lesson_6/run3dvipred.RDS')
run3dvipred
run3residv <- readRDS(file='../Lesson_6/run3residv.RDS')
run3residv
run3respred <- readRDS(file='../Lesson_6/run3respred.RDS')
run3respred
run3ranparcov <- readRDS(file='../Lesson_6/run3ranparcov.RDS')
run3ranparcov
## [[1]]
sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Certara.RsNLME_1.1.0 plotly_4.10.0 ggplot2_3.3.6
[4] flextable_0.7.3
loaded via a namespace (and not attached):
[1] nlme_3.1-157 RColorBrewer_1.1-3 httr_1.4.4
[4] tools_4.2.1 backports_1.4.1 bslib_0.4.0
[7] utf8_1.2.2 R6_2.5.1 DBI_1.1.3
[10] lazyeval_0.2.2 mgcv_1.8-40 colorspace_2.0-3
[13] withr_2.5.0 gridExtra_2.3 GGally_2.1.2
[16] tidyselect_1.1.2 curl_4.3.2 compiler_4.2.1
[19] Certara.Xpose.NLME_1.1.0 cli_3.3.0 gt_0.6.0
[22] xml2_1.3.3 shinyjs_2.1.0 officer_0.4.3
[25] shinymaterial_1.2.0 labeling_0.4.2 sass_0.4.2
[28] scales_1.2.1 checkmate_2.1.0 commonmark_1.8.0
[31] systemfonts_1.0.4 stringr_1.4.1 digest_0.6.29
[34] rmarkdown_2.16 katex_1.4.0 base64enc_0.1-3
[37] Certara.NLME8_1.2.0 pkgconfig_2.0.3 htmltools_0.5.3
[40] fastmap_1.1.0 highr_0.9 htmlwidgets_1.5.4
[43] rlang_1.0.4 rstudioapi_0.13 shiny_1.7.2
[46] jquerylib_0.1.4 farver_2.1.1 generics_0.1.3
[49] jsonlite_1.8.0 crosstalk_1.2.0 dplyr_1.0.9
[52] zip_2.2.0 magrittr_2.0.3 Matrix_1.4-1
[55] Rcpp_1.0.9 munsell_0.5.0 fansi_1.0.3
[58] gdtools_0.2.4 lifecycle_1.0.1 stringi_1.7.8
[61] yaml_2.3.5 gtsummary_1.6.1 MASS_7.3-57
[64] plyr_1.8.7 grid_4.2.1 promises_1.2.0.1
[67] crayon_1.5.1 egg_0.4.5 lattice_0.20-45
[70] splines_4.2.1 knitr_1.40 pillar_1.8.1
[73] uuid_1.1-0 xslt_1.4.3 glue_1.6.2
[76] evaluate_0.16 V8_4.2.1 data.table_1.14.2
[79] broom.helpers_1.8.0 vctrs_0.4.1 tweenr_1.0.2
[82] httpuv_1.6.5 gtable_0.3.0 purrr_0.3.4
[85] polyclip_1.10-0 tidyr_1.2.0 reshape_0.8.9
[88] xpose_0.4.13 assertthat_0.2.1 cachem_1.0.6
[91] xfun_0.32 ggforce_0.3.3 mime_0.12
[94] xtable_1.8-4 later_1.3.0 equatags_0.2.0
[97] viridisLite_0.4.1 tibble_3.1.8 ellipsis_0.3.2